Ternary 三元運算子


Posted by Rich on 2021-04-22

console.log(10 > 5 ? 'bigger' : 'smaller')
output:bigger

condition ? true : false
條件 ? true就執行 : false就執行


#note







Related Posts

心情廢文 8/11

心情廢文 8/11

[ Nuxt.js 2.x 系列文章 ] Nuxt.js 套件應用-CKEditor 5

[ Nuxt.js 2.x 系列文章 ] Nuxt.js 套件應用-CKEditor 5

Laravel view component cache

Laravel view component cache


Comments